package com.itheima.b;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class Test {
    public static void main(String[] args) {
        Collection<Movie> c=new ArrayList<>();

        c.add(new Movie(1,"肖申克的救赎",9.8));
        c.add(new Movie(2,"阿甘正传",9.6));
        c.add(new Movie(3,"无间道",9.9));

        for (Movie movie : c) {
            System.out.println(movie);
        }

        /*Iterator iterator=c.iterator();
        while (iterator.hasNext()) {
            Object next =  iterator.next();
            System.out.println(next);
        }*/
    }
}
